<?php defined('SYSPATH') or die('No direct script access.');

class Model_Dao_Medic extends ORM{

	protected $_table_name  = 'medics'; // default: accounts
    protected $_primary_key = 'id';      // default: id
    protected $_primary_val = 'surname';      // default: name (column used as primary value)
	    
	//'doctype_id'=> array('data_type'=>'int', 'is_nullable' => TRUE),
    
    // default for $_table_columns: use db introspection to find columns and info
    // see http://v3.kohanaphp.com/guide/api/Database_MySQL#list_columns for all possible column attributes
    protected $_table_columns = array(
        'id'   => array('data_type' => 'int',    'is_nullable' => FALSE),
    	'doctype_id' => array('data_type' => 'int',    'is_nullable' => FALSE), 
        'identity_card_number'  => array('data_type' => 'string', 'is_nullable' => FALSE),
    	'surname' => array('data_type'=>'string', 'is_nullable' => FALSE),
    	'name' =>  array('data_type'=>'string', 'is_nullable' => FALSE),
    	'birthdate' => array('data_type'=>'date', 'is_nullable' => FALSE),
    	'address'=> array('data_type'=>'string', 'is_nullable' => TRUE),
    	'phone'=> array('data_type'=>'string', 'is_nullable' => TRUE),
    	'cel' => array('data_type'=>'string', 'is_nullable' => TRUE),
    	'email' => array('data_type'=>'string', 'is_nullable' => TRUE),
    	'sex' => array('data_type'=>'string', 'is_nullable' => FALSE),
    	'city'=> array('data_type'=>'string', 'is_nullable' => TRUE),
    	'specialty'=> array('data_type'=>'string', 'is_nullable' => TRUE)
    
    );
    
    //Relacion
	protected $_belongs_to = array('doctype' => array('model' => 'dao_identitycard', 'foreign_key'=>'doctype_id'));
 
}

